import ajax from './index'




//登录
export function loginBackground(data){
     return ajax.post('/backend/admin/login',data)
}

export function userInfo(){
     return ajax.get('/backend/admin/info')
}

export function admin_update_password(data) {
    return ajax({
        url: "/backend/admin/updatePassword",
        method: "post",
        data: data
    });
}

export function admin_summary(param) {
    return ajax({
        url: "/backend/admin/summary",
        method: "get",
        params: param
    });
}
export function admin_dashboard(param) {
    return ajax({
        url: "/backend/admin/dashboard",
        method: "get",
        params: param
    });
}

export function admin_list(condition) {
    if(!condition) {
        condition = {
            pageNum: 1,
            pageSize: 100
        }
    }
    return ajax({
        url: "/backend/admin/list",
        method: "get",
        params: condition
    });
}

export function admin_detail(id) {
    return ajax({
        url: "/backend/admin/detail/" + id,
        method: "get"
    });
}
export function admin_update(id, param) {
    return ajax({
        url: "/backend/admin/update/" + id,
        method: "post",
        data: param
    });
}

export function admin_save(param) {
    return ajax({
        url: "/backend/admin/save",
        method: "post",
        data: param
    });
}

export function admin_del(id) {
    return ajax({
        url: "/backend/admin/delete/" + id,
        method: "post"
    });
}

